using System.Collections.Generic;
using Belmost4PDA.Fasade;

namespace Belmost4PDA.Logic
{
    public abstract class Control_PanelControl:AbstractControl
    {
        public int ParentID = -1;
        public Control_PanelControl(PanelItem panelItem)
        {
            ParentID = panelItem.IDParent;
        }
        /// <summary>
        /// Gets the controls of panel.
        /// </summary>
        /// <param name="controlsList">The controls list.</param>
        /// <param name="IdPanel">The id panel.</param>
        public override void GetControlsOfPanel(List<AbstractControl> controlsList, int IdPanel)
        {
            if(ParentID==IdPanel)
            {
                controlsList.Add(this);
            }
            foreach (AbstractControl childControl in ChildControls)
            {
                childControl.GetControlsOfPanel(controlsList, IdPanel);
            }
        }
    }
}
